package Arrays;

public class xuanze {
    public static void main(String[] args) {
        //选择排序
        /*
        从0索引开始，拿着每一个索引上的元素跟后面的元素依次比较
         */
        int[] arr = {22,11,44,10,13};
        for (int i = 0;i<arr.length-1;i++){
            for (int j = i+1;j<arr.length;j++){
                if (arr[i]>arr[j]){
                    int temp = arr[i];
                    arr[i] = arr[j];
                    arr[j] = temp;

                }
            }
        }

        for (int i = 0; i<arr.length;i++){
            System.out.println(arr[i]);
        }
    }
}
